Hi All
Does anyone know of a way to tell what the value of an attribute was between two given dates please?
i.e. if I have an attribute named 'Status', I need to check whether it was set to 'Open' between say 1 August 2010 and 1 September 2010.
I have looked at history to see if I can find a way, but I can only find out if it changed - rather than say stayed the same.
Any pointers gratefully received. Thanks.
Roobroo - Wed Oct 27 10:40:28 EDT 2010 |
|
Re: Value of an attribute between dates Mathias Mamsch - Wed Oct 27 11:45:09 EDT 2010
Ouch, that is a tricky subject.
Short answer first: You cannot find out 100% reliably the attribute value for an object using history. Why? Because if you for example change the default value of an attribute, all attribute values with default value will switch, however the only thing recorded in history is "user x changed attribute y".
Ok lets forget about default values for a second. Imagine you know there were no attribute changes, or you use no default values. Lets try finding out the value from history. So imagine we want to know the state of a module on 13th october, however we did a baseline at 1st september and one at 1st november.
Then we could reconstruct the attribute values for all attributes (assumed they all generated history) starting from the first baseline, then applying all changes (stored in the second baseline) in the history until we reach the 13th october. For this to work smothly you would have to keep in mind copying of objects (all attribute values are copied, but no history entry for setting the values) and creating new objects. History records (especially when working with shared edit) are not stored in chronological order, so you need to do some sorting. In addition sometimes with shared edit there are also bugs, that special modifications are not shown.
I programmed something like this once, and it was no treat and still not 100% reliable.
So I would suggest you, if you are interesting in tracking the status of objects, you introduce some DXL mechanisms, which will keep track of the status for you.
Hope this helps, Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: Value of an attribute between dates llandale - Wed Oct 27 14:28:37 EDT 2010
Got the jist of Mathias' post. yes, its what is the value right now then look for History for this obj-attr value whose date is between your dates. If there is no such History then the current value was in force. For any such history, you can get the hst.plainOldValue to figure out what the value was before it was changed, and the hst.plainNewValue to get what it was changed to.
Gets tricky when your date range covers when the module was baselined. In which case you need to open all baselines bla bla bla and its quite the nightmare all in all.
They may have fixed History when I did this sort of chore 4 some years ago, but I recall having to COUNT history to get a 'handle' on the History I wanted (such as the Last History in your date range), then go back through History Counting again until I found the one I wanted. That is, you could not 'save' the value of a History of interest, call by reference/value or something like that.
|
|
Re: Value of an attribute between dates Roobroo - Thu Oct 28 04:07:05 EDT 2010 llandale - Wed Oct 27 14:28:37 EDT 2010
Got the jist of Mathias' post. yes, its what is the value right now then look for History for this obj-attr value whose date is between your dates. If there is no such History then the current value was in force. For any such history, you can get the hst.plainOldValue to figure out what the value was before it was changed, and the hst.plainNewValue to get what it was changed to.
Gets tricky when your date range covers when the module was baselined. In which case you need to open all baselines bla bla bla and its quite the nightmare all in all.
They may have fixed History when I did this sort of chore 4 some years ago, but I recall having to COUNT history to get a 'handle' on the History I wanted (such as the Last History in your date range), then go back through History Counting again until I found the one I wanted. That is, you could not 'save' the value of a History of interest, call by reference/value or something like that.
Thank you both, Louie and Mathias for your detailed responses. Much appreciated. It would appear that as I thought, History is a complicated beast and very hard to work with, but you have given me some good ideas to consider for my approach - and the pitfalls to look out for.
Many thanks
|
|
Re: Value of an attribute between dates David_G_Bond - Thu Oct 28 10:26:34 EDT 2010 Roobroo - Thu Oct 28 04:07:05 EDT 2010
Thank you both, Louie and Mathias for your detailed responses. Much appreciated. It would appear that as I thought, History is a complicated beast and very hard to work with, but you have given me some good ideas to consider for my approach - and the pitfalls to look out for.
Many thanks
You don't need to open all baselines. The baseline of interest is the first baseline made after the date of interest. Then follow the history of the object of interest within that baseline. The easiest way to sort is to use a skip list with the history date as the key. You need only include the history of the attribute of interest in the skip list and only changes to the attribute value (not things like moves). I have written scripts that compare a whole module between two dates specified by the user in this way.
|
|
Re: Value of an attribute between dates Mathias Mamsch - Fri Oct 29 07:19:38 EDT 2010 David_G_Bond - Thu Oct 28 10:26:34 EDT 2010
You don't need to open all baselines. The baseline of interest is the first baseline made after the date of interest. Then follow the history of the object of interest within that baseline. The easiest way to sort is to use a skip list with the history date as the key. You need only include the history of the attribute of interest in the skip list and only changes to the attribute value (not things like moves). I have written scripts that compare a whole module between two dates specified by the user in this way.
You mean the first baseline "before" the date, right? Because any purged object coming to live when going through the history backwards needs to be filled with some values. Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|